import '../lib/data/master_vocabulary.dart';

void main() {
  print('🚀 Huggo 世界语词汇库验证');
  print('=' * 50);
  
  // 获取验证数据
  final validation = MasterVocabulary.validateData();
  
  print('📊 词汇库统计:');
  print('  总词汇数: ${validation['totalWords']}');
  print('  类别数: ${validation['categories']}');
  print('');
  
  print('📚 各类别词汇数量:');
  final categoryStats = validation['categoryStats'] as Map<String, int>;
  for (final entry in categoryStats.entries) {
    final description = MasterVocabulary.getCategoryDescription(entry.key);
    print('  ${entry.key}: ${entry.value} 词 - $description');
  }
  print('');
  
  print('🎯 难度分布:');
  final difficultyStats = validation['difficultyStats'] as Map<int, int>;
  for (final entry in difficultyStats.entries) {
    final description = MasterVocabulary.getDifficultyDescription(entry.key);
    print('  难度 ${entry.key}: ${entry.value} 词 - $description');
  }
  print('');
  
  print('🔍 数据完整性检查:');
  final issues = validation['issues'] as List<String>;
  if (issues.isEmpty) {
    print('  ✅ 数据完整性良好，无问题发现');
  } else {
    print('  ❌ 发现 ${issues.length} 个问题:');
    for (final issue in issues) {
      print('    - $issue');
    }
  }
  print('');
  
  print('🎲 推荐学习序列:');
  final sequence = MasterVocabulary.getRecommendedLearningSequence();
  for (int i = 0; i < sequence.length; i++) {
    final category = sequence[i];
    final count = categoryStats[category] ?? 0;
    print('  ${i + 1}. $category ($count 词)');
  }
  print('');
  
  print('✨ 词汇库验证完成！');
  
  // 显示一些示例词汇
  print('\n📖 各类别示例词汇:');
  for (final category in MasterVocabulary.getAllCategories().take(5)) {
    final words = MasterVocabulary.getWordsByCategory(category);
    if (words.isNotEmpty) {
      final word = words.first;
      print('  $category: ${word.esperanto} (${word.english}) - ${word.pronunciation}');
    }
  }
} 